﻿function issub()
 {
 	 var i = 0;
 	 var count = 0;
 	 count = 0;
   var title = document.getElementById("title").value;
      if(title == "null" ||title =="")
    {
        alert("请输入标题，谢谢！");
        document.getElementById("title").focus();
        return;
    }
 
   var keywords = document.getElementById("keywords_2").value;
      if(keywords == "null" ||keywords =="")
    {
        alert("请输入需求关键词，谢谢！");
        document.getElementById("keywords_2").focus();
        return;
    }
    
   
   
   count = 0;
      var item_16 = document.getElementsByName("item_16");
      for(i=0;i<item_16.length;i++){
      	  if(item_16[i].checked==true){
      	  	 count++;
      	  	}
      	}
      if(count==0){
      	 alert('请选择所处阶段!');
      	
      	 return;
      	} else if(count>1){
      		alert('您最多只能选择１项所处阶段!');
      	
      		return;
        }
   count = 0;
      var needreason = document.getElementsByName("NeedReason");
      for(i=0;i<needreason.length;i++){
      	  if(needreason[i].checked==true){
      	  	 count++;
      	  	}
      	}
      if(count==0){
      	 alert('请选择需求缘由!');
      	 
      	 return;
      	} else if(count>3){
      		alert('您最多只能选择3项需求缘由!');
      	
      		return;
        }
   
   count = 0;
      var cooperate = document.getElementsByName("Cooperate");
      for(i=0;i<cooperate.length;i++){
      	  if(cooperate[i].checked==true){
      	  	 count++;
      	  	}
      	}
      if(count==0){
      	 alert('请选择合作方式!');
      	 
      	 return;
      	} else if(count>3){
      		alert('您最多只能选择3项合作方式!');
      		
      		return;
        }
     
   var techneed = document.getElementById("techneed").value;
      if(techneed == "null" ||techneed =="")
    {
        alert("请输入技术需求说明，谢谢！");
        document.getElementById("techneed").focus();
        return;
    }
    
    count = 0;
      var needertype = document.getElementsByName("needertype");
      for(i=0;i<needertype.length;i++){
      	  if(needertype[i].checked==true){
      	  	 count++;
      	  	}
      	}
      if(count==0){
      	 alert('请选择需求方类型!');
      	 
      	 return;
      	} else if(count>1){
      		alert('您最多只能选择1项需求方类型!');
      		
      		return;
        }
        
 	    if (needertype[0].checked ==true){
    	 var unitname = document.getElementById("unitname").value;
     /* if(unitname == "null" ||unitname =="")
    {
        alert("请输入机构名称，谢谢！");
        document.all.unitname.focus();
        return;
    }*/
  }
     if (needertype[0].checked ==true){
    count = 0;
    var province = document.getElementById("province").options[document.getElementById("province").selectedIndex].value;
      if(province == " "){
      	alert('请选择所属地域!');
      	 
      	 return;
      	
      	}
      }
    var linkman = document.getElementById("linkman").value;
      if(linkman == "null" ||linkman=="")
    {
        alert("请输入联系人，谢谢！");
        document.getElementById("linkman").focus();
        return;
    }
    
    var email = document.getElementById("email").value;
      if(email == "null" ||email=="")
    {
        alert("请输入E-mail，谢谢！");
        document.getElementById("email").focus();
        return;
    }
    
     var tel = document.getElementById("tel").value;
      if(tel == "null" ||tel=="")
    {
        alert("请输入固定电话/手机，谢谢！");
        document.getElementById("tel").focus();
        return;
    }
    
     var zip = document.getElementById("zip").value;
      if(zip!="null"){
      	  if (zip.length>6){
      	  	alert("邮政编码位数不能超过6位，谢谢！");
      	  	document.getElementById("zip").focus();
      	  	return;
      	  	}
      	
      	}
    
    
    
   var regmoney = document.getElementById("regmoney").value;
      if(regmoney != "null" ||title != "")
    {   
    	   if(isNaN(regmoney)){

        alert("注册/开办资金请输入数字，谢谢！");
        return;
       } 
    }
    
    var salemoney = document.getElementById("salemoney").value;
      if(salemoney != "null" ||title != "")
    {   
    	   if(isNaN(salemoney)){

        alert("上年销售额请输入数字，谢谢！");
        return;
       } 
    }
    
    
    document.getElementById("tijiao").submit();  
 
 
}

function show(obj){
	var needertypenew = document.getElementsByName("needertype");
	    for (var i=0; i<needertypenew.length; i++){   
             if (needertypenew[i]!=obj){
                needertypenew[i].checked = false;  
             }
             else {
                if(obj.checked == false) {
                    needertypenew[i].checked = false;
                } 
                else {
                    needertypenew[i].checked = true;
                }
                 
             }
         }

	
	    for( i=0;i<needertypenew.length;i++){
	    if(needertypenew[0].checked==true ){
	    	document.getElementById("jigou").style.display="";
	    	}else{
	    		document.getElementById("jigou").style.display="none";
	    		
	    		}
   }
}



 function  check_subcheck(obj,objname) {
       var i = 0;
      alert("obj"+obj+"bbbbbb");
      var objname_c = document.getElementsByName(objname);
      //alert(objname_c.length);
      for(i=0;i<objname_c.length;i++){
      	     alert("bbbbb"+objname_c[i].value+"aaaaaa");
	       if (trim(objname_c[i].value) == trim(obj)){
	       	   objname_c[i].checked = true;
	       	   //alert("dddddddd");
	       	}else {
	       		 objname_c[i].checked = false;
	       		}
	  }	
	
} 